using System;
using System.Collections.Generic;
using System.Text;

namespace LetraDNI
{
    class Program
    {
        static int n = 4;
        static int k = 2;
        static string elementos = "abcd";
        static void Normaliza(ref int[] vector) {
            for (int i = 0; i < vector.Length; i++) {
                if (vector[i] >= n) { vector[i] = 0; vector[i + 1] += 1; }
            }
        }

        static void Muestra(int[] vector) {
            for (int i = 0; i < vector.Length; i++) {
                Console.Write(elementos[vector[i]]);
            }
            Console.WriteLine();
        }
        static void Main(String[] args)
        {
            int[] vector = new int[k];
            for (int i = 0; i<(Math.Pow(n, k) - 1); i++) {
                vector[0] += 1;
                Normaliza(ref vector);
                Muestra(vector);

            }
        }
    }
}
